﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Esb.ManageUI.Controllers
{
    public class LoginController : Controller
    {
        //
        // GET: /Login/

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 登录
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Index(int? id)
        {
            string userName = Request["UserName"];
            string password = Request["Password"];
            if (password == "111111" && userName == "1001")
            {
                Session["UserName"] = userName;
                Response.Redirect("~/ManageService");
                return null;
            }
            else
            {
                ViewBag.Scripts = "<Script>alert('用户名或密码错误！');</Script>";
                return View();
            }
        }
    }
}
